package com.liang.autoconfigure;

import com.liang.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liangben
 * @date 10/4/2022 下午 4:36
 */
@Configuration
@EnableConfigurationProperties(DemoProperties.class)
public class DemoAutoconfigure {

    @Autowired
    private DemoProperties demoProperties;

    @Bean
    public DemoService getDemoService(){
        return new DemoService(demoProperties);
    }


}
